﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MAPDavy.Entities;
using MAPDavy.Repository;
using Microsoft.Practices.Unity;
using DocumentFormat.OpenXml.Spreadsheet;

namespace MAPDavy.BusinessLogic
{
    public class ScoreBL:IScoreBL
    {
        [Dependency]
        public IScoreRepository  ScoreRepository { get; set; }

        public List<ScoreDTO> GetFromScoreByTermIdAndSeccionIdAndTestId(int termId, int seccionId, int testId)
        {
            return ScoreRepository.GetFromScoreByTermIdAndSeccionIdAndTestId(termId,seccionId,testId); 
        }


        public void RegistrarScore(Score score)
        {
            ScoreRepository.RegistrarScore(score);  
        }


        public List<MAPRit> RetrieveTemplateRit(DocumentFormat.OpenXml.Spreadsheet.Worksheet worksheet, DocumentFormat.OpenXml.Spreadsheet.SharedStringTable sharedStringTable)
        {
            return Library.RetrieveTemplateRit(worksheet, sharedStringTable);
        }


        public List<ScoreDTO> GetFromScoreByTermIdAndGradeIdAndTest(int termId, int gradeId, int testId)
        {
            return ScoreRepository.GetFromScoreByTermIdAndGradeIdAndTest(termId, gradeId, testId);
        }


        public int RegistrarScore(List<Score> scores)
        {
            return ScoreRepository.RegistrarScore(scores);
        }
    }
}
